package com.liugl.recyclerviewtest

import adapters.LayoutType
import android.os.Bundle
import android.view.View
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : BasicActivity(), View.OnClickListener {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        recycle.setOnClickListener(this)
        hRecycle.setOnClickListener(this)
        gRecycle.setOnClickListener(this)
        waterfall.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        AllRecycler.actionStart(
            this, when (v) {
                recycle -> LayoutType.SIMPLE
                hRecycle -> LayoutType.HORIZONTAL
                gRecycle -> LayoutType.GRID
                waterfall -> LayoutType.WATERFALL

                else -> LayoutType.SIMPLE
            }
        )
    }
}